#pragma once
#include "DXAMLCommon.h"

#include "XamlNode.h"

class XamlProperty;
struct XamlQualifiedObject;
class XamlNamespace;
class XamlSchemaContext;
class XamlType;
class XamlNode;


class XamlWriter
{

private: 
	XamlLineInfo m_LineInfo;
protected: 
	XamlNode m_WorkingNode;

public: 
	XamlWriter();
	virtual ~XamlWriter();
	virtual HRESULT WriteObject(const xshared_ptr<XamlType> & spXamlType, XUINT32 fromMember) = 0;
	virtual HRESULT WriteEndObject() = 0;
	virtual HRESULT WriteMember(const xshared_ptr<XamlProperty> & spProperty) = 0;
	virtual HRESULT WriteEndMember() = 0;
	virtual HRESULT WriteValue(const xshared_ptr<XamlQualifiedObject> & value) = 0;
	virtual HRESULT WriteNamespace(const xshared_ptr<CXString> & spPrefix, const xshared_ptr<XamlNamespace> & spXamlNamespace) = 0;
	virtual HRESULT WriteNode(const XamlNode & xamlNode);
	virtual HRESULT GetSchemaContext(xshared_ptr<XamlSchemaContext> & rspOut) = 0;
	const XamlLineInfo & GetLineInfo();
	void SetLineInfo(const XamlLineInfo & inLineInfo);
	virtual HRESULT Close();
protected: 
	virtual HRESULT ProcessError();
};



